<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '角色信息列表';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="role-index">
    <p>
        <?= Html::a('角色添加', ['create'], ['class' => 'btn btn-success']) ?>
    </p>
    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'id',
            'role_name',

            ['class' => 'yii\grid\ActionColumn','template' => '{view} {setrole} {update} {delete}',
				 'buttons' => [
					'setrole' => function ($url,$model) {
						return Html::a('<span class="glyphicon glyphicon-asterisk"></span>', '/role_access/index?id='.$model->id, ['title' => '设置用户权限'] );
					},
				],
			],
        ],
    ]); ?>
</div>
